/**
 * Created by jn-dinggao on 2017/7/20.
 */
app.factory('InfoRoleAuthService',  function($http, $q, $resource, $cookieStore, serviceUtil, ACTIONS, METHODS ,URL){
    var factory = {};
    var param = {};
    var roleAuthUrl = URL.BASEURL + URL.ROLEAUTHURL;
    var initParam = function(){
        param = {};
    };
    factory.findRoleAndAuth = function(userId,roleId) {
        initParam();
        param.roleId = roleId;
        param.userId = userId;
        return serviceUtil.excute(roleAuthUrl +'findRoleAndAuth', param, METHODS.getList);
    };

    factory.addRoleAuth = function(roleAuth) {
        return serviceUtil.excute(roleAuthUrl + 'addAuthForRole', roleAuth ,METHODS.save);
    };

    factory.deleteById = function(roleAuthId) {
        initParam();
        param = {};
        return serviceUtil.excute(roleAuthUrl +'delete/' + roleAuthId, param ,METHODS.delete);
    };

    return factory;
});